/*
 * socket related helpers
 *
 * $Id: sock.h 27 2009-05-05 08:07:24Z ybc2084 $
 */

#ifndef _SOCK_H_
#define _SOCK_H_

#ifdef	__cplusplus
extern "C" {
#endif

/*
 * return a socket connecting to 'ipaddr:port',
 * return -1 if failed.
 */
extern int connTo(const char *ipaddr, int port);

/*
 * return a socket listening on 'ipaddr:port',
 * return -1 if failed.
 */
extern int listenOn(const char *ipaddr, int port);


#ifdef	__cplusplus
}
#endif

#endif	/* _SOCK_H_*/

